package com.hqyj.springCloudWeb.controller;

import com.hqyj.entity.account.User;
import com.hqyj.entity.common.ResultEntity;
import com.hqyj.springCloudWeb.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @author yun
 * @date 2021-5-13 20:31
 */
@RestController
@RequestMapping("/api")
public class UserController {

    @Autowired
    private UserService userService;

    @PostMapping(value = "/login", consumes = "application/json")
    public ResultEntity<User> login(@RequestBody User user) {
        return userService.login(user);
    }

    @PutMapping(value = "/user", consumes = "application/json")
    public ResultEntity<User> updateUser(@RequestBody User user) {
        return userService.updateUser(user);
    }
}
